package com.iron.sfm.api.feign.factory;

import com.iron.sfm.api.feign.fallback.SysLogFeignFallbackImpl;
import com.iron.sfm.api.feign.SysLogFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author YT
 * @date 2019-06-27
 */
@Component
public class SysLogFeignFallbackFactory implements FallbackFactory<SysLogFeign> {

    @Override
    public SysLogFeign create(Throwable throwable) {
        SysLogFeignFallbackImpl sysLogFeignFallback = new SysLogFeignFallbackImpl();
        sysLogFeignFallback.setCause(throwable);
        return sysLogFeignFallback;
    }
}
